package com.ln.lnzw.adapter;

import android.support.annotation.Nullable;
import android.support.v7.widget.CardView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.blankj.utilcode.util.ScreenUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ln.lnzw.R;
import com.ln.lnzw.utils.ImageUtil;

import java.util.List;

/**
 * Created by wuwei on 2018/3/30.
 */

public class ServiceTuiJianAdapter extends BaseQuickAdapter<Integer,BaseViewHolder>{
    private ImageView mImageView;
    public ServiceTuiJianAdapter(int layoutResId, @Nullable List<Integer> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, Integer item) {
        mImageView = helper.getView(R.id.imageView);
        ViewGroup.LayoutParams layoutParams = mImageView.getLayoutParams();
        layoutParams.width= ScreenUtils.getScreenWidth()/3+(ScreenUtils.getScreenWidth()/3)/3-40;
        layoutParams.height=layoutParams.width/2-20;
        mImageView.setLayoutParams(layoutParams);
        mImageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
        mImageView.setImageResource(item);

    }
}
